package com.wyx.controller;


import com.wyx.entity.Class;
import com.wyx.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 王云翔
 * @since 2022-03-08
 */
@RestController
@RequestMapping("/class")
public class ClassController {
    @Autowired
    private ClassService service;

    @GetMapping("/select")
    public Map<String, Object> selectAll(){
        List<Class> list = service.list();
        return new HashMap<String, Object>(){
            {
                put("stutas","succes");
                put("class",list);
            }
        };
    }
}

